package com.efuture.servlet.serveletcontext;

import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;
import java.io.IOException;

/**
 * @description: 演示域对象 共享数据
 * @author zhaoshanshan
 * @date 2021/10/3 3:00 下午
 * @version 1.0
 */
@WebServlet("/DomainObjectTestOne")
public class DomainObjectTestOne extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       ServletContext context = this.getServletContext();
       context.setAttribute("msg","我是共享数据");
    }
}
